﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WXYW.BLL;
using WXYW.DAL;

namespace WXYW
{
    public partial class SparePartApplyDisagree : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitialPage();
            }
        }

        private void InitialPage()
        {
            SparePartApplyService service = new SparePartApplyService();
            SparePartApplyForm sparePartApplyForm = service.GetProductDetailForm(long.Parse(Request.QueryString[Constants.QUERYSTR_SPAREPARTAPPLY_ID]));
            productTypeLabel.Text = sparePartApplyForm.ApplicationProduct.ProductType.ProductTypeName;
            serialNumberLabel.Text = sparePartApplyForm.ApplicationProduct.ProductSerialNumber;
            problemTypeLabel.Text = sparePartApplyForm.ApplicationProduct.ProblemType.Name;
            decriptionLabel.Text = sparePartApplyForm.ApplicationProduct.ProductProblemDescription;
            appearanceLabel.Text = sparePartApplyForm.ApplicationProduct.ProductAppearance;
            repairTypeLabel.Text = sparePartApplyForm.ApplicationProduct.ProductRepairType;
            examineResultLabel.Text = sparePartApplyForm.ApplicationProduct.Remark;
            Reason.Text = sparePartApplyForm.DeclineReason;
            applicationDateLbl.Text = sparePartApplyForm.ApplyTime.HasValue ? sparePartApplyForm.ApplyTime.Value.ToString("yyyy-MM-dd") : "";
            receiveDateLbl.Text = sparePartApplyForm.ReceiveTime.HasValue ? sparePartApplyForm.ReceiveTime.Value.ToString("yyyy-MM-dd") : "";
            sendDateLbl.Text = sparePartApplyForm.SendTime.HasValue ? sparePartApplyForm.SendTime.Value.ToString("yyyy-MM-dd") : "";
            statusLbl.Text = sparePartApplyForm.Status;
        }
    }
}
